Repository navigation
soc: apple: mailbox: Make the send-empty IRQ optional (poll TX) - #65
Conversation
|
Update on the jw16 (M1 Max) caveats in the description. The SET0 power state is now confirmed: with ane.ko bound, the SET-window read returned word0 0x3ff and the aggregate state act=0xffffff. The genpd domains set1-4, base and sys_cpu are on. The unplanned reboot still has no established cause. The journal and netconsole stop at a debugfs automount, and pstore is empty. That session had read a raw pmgr regmap through debugfs, and we have not repeated that read. |
receipts: DT bindings for the ANE nodes of aurora-silicon/linux#65
|
Mailbox change LGTM. As for adding device tree nodes, I think it's best added with the driver PR itself, without it, the nodes would be no use here in the kernel. And as far as t602x support is concerned - disabling it would be a temp. workaround - it can be resolved in the driver right? I'm not too familiar with ANE. But if keeping it enabled does nothing harmful, we can just leave it enabled for simplicity. |
The T6021 (M2 Max) ANE coprocessor mailbox is an ASC mailbox, but only one of its interrupts is known: the Apple device tree gives the ANE a single interrupt line. The binding requires the four ASC mailbox interrupts in a fixed order, so a node for this mailbox fails dtbs_check. Add the apple,t6021-ane-mailbox compatible with the apple,asc-mailbox-v4 fallback. For it, recv-not-empty is the only required interrupt; send-empty, send-not-empty and recv-empty may follow in that order. Without send-empty, the OS must poll the FIFO status before it sends. The other variants keep their constraints. The four-interrupt rule moves into a condition that excludes the ANE and AOP setup mailboxes, and the AOP setup mailbox states its minimum of two interrupts, which the top-level limit gave it before. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
The T6021 (M2 Max) ANE coprocessor mailbox has one known AIC line, which the device tree names recv-not-empty. apple-mailbox insists on a send-empty IRQ as well, so it cannot bind that mailbox. Look send-empty up with platform_get_irq_byname_optional(). When the node has none (-ENXIO), do not request it, and let apple_mbox_send() wait for FIFO space by polling the A2I control register, the way its atomic path already does (100 us steps, 500 ms timeout, under tx_lock). Any other lookup error still fails the probe with -ENODEV. A mailbox whose node names send-empty takes the old path unchanged: the IRQ is requested at the same point with the same flags and name, and a non-atomic send still sleeps on tx_empty. All 71 apple-mailbox nodes in arch/arm64/boot/dts/apple name send-empty today. The Rust wrapper (RUST_APPLE_MAILBOX) needs no change. It only calls apple_mbox_get_byname(), apple_mbox_start(), apple_mbox_send() and apple_mbox_stop(), and never reads the IRQ fields, so a Rust client gets the poll through apple_mbox_send(). An equivalent change ran on an M2 Max lab kernel (Asahi 7.1.13 base) from 2026-09-24 to 2026-09-30, where apple-mailbox bound the one-interrupt ANE mailbox. The FIFO-full poll itself did not run there: with the ANE firmware in use (from macOS 13.5), the host sends no mailbox message after probe. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
30071bf to
0024815
Compare
|
Thanks, Dj. I've cut this PR down to the mailbox change and its binding update. The ANE nodes and the ANE binding will come with the driver PR, as you suggested. On t602x: the driver now runs the firmware from its own memory, so it no longer depends on iBoot's preloaded copy. The nodes can stay enabled on M2 Pro, Max and Ultra with no workaround, and I'll do it that way in the driver PR. |
|
Included in our 11.25 release candidate (iconidentify/aurora-linux) together with #155. With the send-empty IRQ present, behaviour is unchanged: every existing mailbox node in the Apple DTs still has it, so only the two new ANE mailboxes take the polling path. M1 Air lab boot: no regressions, and no mailbox errors across DCP, SMC, SEP and audio. |
[follow-up to #65] soc: apple: mailbox: propagate IRQ lookup errors Original contributor commits are preserved. Conflict resolutions retain the audited shared driver APIs and their integrated review fixes. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Chris Kearney <303316+iconidentify@users.noreply.github.com>
soc: apple: mailbox: Make the send-empty IRQ optional (poll TX) Original contributor commits are preserved. Conflict resolutions retain the audited shared driver APIs and their integrated review fixes. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This PR now holds only the mailbox change, as asked in review. The ANE device-tree nodes and the
apple,ane.yamlbinding move to the ANE driver PR. The earlier 6-commit version stays available as tagane-dt-polltx-aurora-v1(30071bf4).What. apple-mailbox no longer requires a
send-emptyIRQ. A node without it gets no IRQ request for that line, andapple_mbox_send()polls the A2I control register for FIFO space, as its atomic path already does (100 us steps, 500 ms timeout). A node that namessend-emptytakes the old path unchanged; all 71 apple-mailbox nodes inarch/arm64/boot/dts/appledo. The binding gets theapple,t6021-ane-mailboxvariant, for whichrecv-not-emptyis the only required interrupt. The other variants keep their constraints.Why. The Apple device tree gives the T602x ANE one interrupt line, so a node that describes the ANE coprocessor mailbox has no
send-empty, and apple-mailbox does not bind it today.Test status.
drivers/soc/apple/mailbox.ofor arm64 withW=1gives 0 warnings (aarch64-linux-gnu-gcc 12.2.0, linux-aurora package config with RUST off, because the build host has no bindgen).checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks on both commits.make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml(dtschema 2026.9): exit 0, no findings.send-emptyline (AIC 1833) that never fires, and the driver leaves the mailbox stopped by default (receipt). So no current user needs this patch. It lets the in-tree device tree describe the ANE mailbox without a placeholder IRQ.